package model;

public class MapGrid {
	
	private MapGridCell[][] grid;
	private int mapWidth;
	private int mapHeight;
	
	public MapGrid(int width, int height) {
		grid = new MapGridCell[width][height];
	}
	
	public boolean withinMap(int xLoc, int yLoc) {
		return (xLoc >= 0 && xLoc < mapWidth && yLoc >= 0 && yLoc < mapHeight);
	}

	public MapGridCell[][] getGrid() {
		return grid;
	}

	public void setGrid(MapGridCell[][] grid) {
		this.grid = grid;
	}
	
	public int getVisibilityAt(int x, int y) {
		return grid[x][y].getLandType().getVisibility();
	}

	public int getMapWidth() {
		return mapWidth;
	}

	public void setMapWidth(int mapWidth) {
		this.mapWidth = mapWidth;
	}

	public int getMapHeight() {
		return mapHeight;
	}

	public void setMapHeight(int mapHeight) {
		this.mapHeight = mapHeight;
	}
}
